package com.anmingle.pswb.service;

import com.anmingle.pswb.entity.LoginUser;
import com.anmingle.pswb.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * @author 安明乐
 * @Title UserService
 * @Package IntelliJ IDEA
 * @date 2022/11/18 16:57
 */
public interface UserService extends IService<User> {

    /**
     * 退出登录
     * @return
     */
    boolean loginOut();

    /**
     * 登录
     * @param user
     * @return
     */
    Map<String, Object> login(String user, String password);

    /**
     * 注册
     * @param user 用户名
     * @param password 密码
     * @param checkPassword 校验
     * @param phone 手机号
     * @param name 用户昵称
     * @return 用户id
     */
    long userRegister(String user, String password, String checkPassword, String phone, String name );

    /**
     * 微信小程序的登录
     * @param openid
     * @param nickname
     * @param image
     * @param password
     * @param checkPassword
     * @param phone
     * @return
     */
    Map<String, Object> WXlogin(String openid, String nickname, String image, String password, String checkPassword, String phone);

    /**
     * 获取当前登录的user
     * @return user实体类
     */
    LoginUser getUser();

}

